<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/3/10
 * Time: 15:56
 */

echo "<title>6-12 PHP中循环结构之foreach循环语句(任务一) </title>";
echo "<p style='text-align: center'><a href=\"index.php\"><font size=\"4\">目录</font></a></p>";
header("Content-type: text/html; charset=utf-8");
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";

$students = array(
    '2010'=>'令狐冲',
    '2011'=>'林平之',
    '2012'=>'曲洋',
    '2013'=>'任盈盈',
    '2014'=>'向问天',
    '2015'=>'任我行',
    '2016'=>'冲虚',
    '2017'=>'方正',
    '2018'=>'岳不群',
    '2019'=>'宁中则',
);//10个学生的学号和姓名，用数组存储

//使用循环结构遍历数组，获取学号和姓名
foreach($students as $v)
{
    echo $v;//输出（打印）姓名
    echo "<br />";
}